package com.unionx.unionxuf.service;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.unionx.unionxuf.dao.CredenceDao;
import com.unionx.unionxuf.entity.Credence;
import com.unionx.unionxuf.localdao.CredenceMapper;

@Service("credenceService")
public class CredenceServiceImpl implements CredenceService {
	@Autowired(required = true)
	private CredenceDao credenceDao;
	@Autowired(required = true)
	private CredenceMapper credenceMapper;
	Map<String,Object> map =  new HashMap<String,Object>();
	public Object saveCredence(Credence credence) {
		map.clear();
		try {
			int i = credenceMapper.insert(credence);
			map.put("status", 0);
			map.put("message", "方法请求成功");
			map.put("total", i);

		} catch (Exception e) {
			map.put("status", 1);
			map.put("message", "方法请求失败");
			map.put("total", "500");
		}
		return map;

	}

}
